home *** CD-ROM | disk | FTP | other *** search
/ Best Tools for JAVA / Best Tools for JAVA.iso / CONVERTR / RTF2HTML / SRC / RTF2HTML.TAR / rtftohtml_src / rtftohtml.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-05  |  4.3 KB  |  185 lines

  1. #include "vers.h"
  2. #define Htran 3
  3.  
  4. /* Attributes of input stream */
  5. #ifndef Edef
  6. #define Edef extern
  7. #endif
  8. /*    Text Styles */
  9.  
  10.     
  11. # define stylePlain            0
  12. # define styleBold            1<<0
  13. # define styleItalic        1<<1                            
  14. # define styleStrikeThru    1<<2
  15. # define styleOutline        1<<3
  16. # define styleShadow        1<<4
  17. # define styleSmallCaps        1<<5
  18. # define styleAllCaps        1<<6
  19. # define styleInvisible        1<<7
  20. # define styleUnderline        1<<8
  21. # define styleWUnderline    1<<9
  22. # define styleDUnderline    1<<10
  23. # define styleDbUnderline    1<<11
  24. # define styleSuperScript    1<<12
  25. # define styleSubScript        1<<13
  26.  
  27. typedef long TStyle_typ;
  28.     
  29. # define MTLiteral    9999
  30. # define MTDiscard    9998
  31. # define MTName        9997
  32. # define MTHref        9996
  33. # define MTHot        9995
  34. # define MTFootNote 9994
  35. # define MTSPECIAL  9993
  36.  
  37. typedef struct  {
  38.     char * Font;            /* Font */
  39.     int FSize;                /* font size */
  40.     TStyle_typ TStyle;        /* Styles that need to match */
  41.     TStyle_typ TMask;        /* Styles that are considered */
  42.     int TTidx;                /* Index into Output Text Style table - or - MTType*/
  43. } TMatchRec;
  44. Edef TMatchRec * TMatchArr;
  45. Edef int TMatchLen;
  46. Edef int TMatchAlloc;
  47.  
  48. typedef struct  {
  49.     char *PStyle;    /* The Paragraph Style (or some specials) */
  50.     int NestLev;    /* The nesting level represented by this style */
  51.     int PTidx;        /* Index into PTags table */
  52. } PMatchRec;
  53. Edef PMatchRec * PMatchArr;
  54. Edef int PMatchLen;
  55. Edef int PMatchAlloc;
  56.  
  57. typedef struct  {
  58.     char *Name;
  59.     char *StartTag;
  60.     char *EndTag;
  61.     char *Col2Tag;
  62.     char *TabTag;
  63.     char *ParTag;
  64.     int AllowText;
  65.     int CanNest;
  66.     int DeleteCol1;
  67.     int DoFold;
  68.     int ToCLev;
  69. }PTagRec;
  70. Edef PTagRec *PTagArr;
  71. Edef int PTagLen;
  72. Edef int PTagAlloc;
  73.  
  74. typedef struct  {
  75.     char *Name;
  76.     char *StartTag;
  77.     char *EndTag;
  78. } TTagRec;
  79. Edef TTagRec * TTagArr;
  80. Edef int TTagLen;
  81. Edef int TTagAlloc;
  82.  
  83. typedef struct  InStateRec{
  84.     char *ParStyle;                /* Paragraph Style Name */
  85.     TStyle_typ TStyle;            /* Bitmask of Text Styles */
  86.     char *TFont;                /* Points to Font String */
  87.     int TSize;                    /* Pointsize of Font */
  88.     int destination;            /* The current input destination */
  89.     int isfootref;                /* Is this a footnote ref? */
  90.     int inTable;                /* In a table */
  91.     int firstcell;                /* first cell definition */
  92.     int cellno;                    /* current cell number */
  93.     int lastcell;                /* last cell number */
  94.     int ToCLev;                    /* Table of Contents Level */
  95.     struct InStateRec *Next;
  96. } InStateStack;
  97.  
  98.  
  99. /* Destinations can be files or strings.  */
  100.  
  101.  
  102. #define DSALLOC        256
  103.  
  104. struct SDest {
  105.     char *ptr;            /* Output string  */
  106.     int alloc;            /* allocation size */
  107.     int used;            /* Number of bytes in destination */
  108. };
  109.  
  110.  
  111. #define CELLMAX    80
  112. Edef struct {
  113.     short width;                /* width in character positions */
  114.     short just;                /* justify (left,center,right) */
  115.     short merge;            /* merged with previous cell? */
  116.     struct SDest cbuff;        /* buffer for holding cell data */
  117.     short cpos;                /* output char position */
  118. } cell[CELLMAX];
  119. #define TWIPSperCHAR    109
  120. #define AdjL    0
  121. #define AdjLPad    1
  122. #define AdjRPad    2
  123. #define AdjCpad    3
  124.  
  125. void    PutHTML ();
  126.  
  127.  
  128. /* output file types */
  129.  
  130. # define    FTTEXT    1        /* text (.html) file */
  131. # define    FTPICT    2        /* PICT graphic file */
  132. # define    FTWMF    3        /* Windows metafile */
  133. # define    FTBMF    4        /* Bitmap file */
  134.  
  135.  
  136. void WriterInit();
  137. int do_main ();
  138. FILE *OpenOutputFile ();
  139. char *Basename ();
  140.  
  141. extern char *FPrefix;        /* Base name of output files */
  142. extern char *FPrefixR;        /* Relative name of output files */
  143.  
  144. extern char *OutfileName;            /* output file name */
  145. extern char *InfileName;    /* input file name */
  146.  
  147. extern char PFileExt[];    /* extension to be used for links to pictures */
  148. extern int linkself;
  149.  
  150. /* Translator Options */
  151. extern int debug;
  152. extern int IMG;
  153. extern int ToC;
  154. extern int WriteGraf;
  155. Edef int PicGoalWid;
  156. Edef int PicGoalHt;
  157. Edef char * PictExt;
  158. Edef int PictType;
  159.  
  160. extern int IStyle_Chg;        /* Has input style changed? */
  161.  
  162. /* Input State Variables */
  163. extern char *ParStyle;        /* Paragraph Style Name */
  164. extern TStyle_typ TStyle;    /* Bitmask of Text Styles */
  165. extern char *TFont;        /* Points to Font String */
  166. extern int TSize;        /* Pointsize of Font */
  167. extern int inTable;            /* In a table? */
  168. extern int ToCLev;
  169. extern int cellno;
  170. extern int firstcell;
  171. extern int lastcell;
  172. extern int destination;        /* The current input destination */
  173. extern RTFFont *fp;            /* Actual Font Pointer */
  174.  
  175. extern InStateStack *ISS;
  176.  
  177.  
  178. extern char *outMap[];
  179. InStateStack *SaveIState();
  180. void RestoreIState();
  181.  
  182. void
  183. NabPicture();
  184.  
  185.